<?php
/**
 * 美妆镜 APP 相关接口
 *
 * Author: Zeon
 * Date: 2018/3/23
 * Created by Panxsoft.
 */

use App\Http\Controllers\App\DeviceAccountController;
use Illuminate\Support\Facades\Route;

/**
 * @see \App\Http\Controllers\App\DeviceAccountController::login()
 */
Route::post('device-account/login', 'DeviceAccountController@login')
    ->middleware('AppLocale')
    ->name(DeviceAccountController::ROUTES['login']);

/**
 * @see \App\Http\Controllers\App\WechatUserController::updateOrCreate()
 */
Route::post('user/update-or-create', 'WechatUserController@updateOrCreate')
    ->name(\App\Http\Controllers\App\WechatUserController::ROUTES['updateOrCreate']);

/**
 * @see \App\Http\Controllers\App\WechatUserController::loginQrCode()
 */
Route::get('user/login-qr-code', 'WechatUserController@loginQrCode')
    ->name(\App\Http\Controllers\App\WechatUserController::ROUTES['login']);

/**
 * @see \App\Http\Controllers\App\WechatUserController::loginPoll()
 */
Route::get('user/login-poll', 'WechatUserController@loginPoll')
    ->name(\App\Http\Controllers\App\WechatUserController::ROUTES['poll']);

/**
 * @deprecated
 *
 * @see \App\Http\Controllers\App\WechatUserController::showSkinRecord()
 */
Route::get('user-skin-record/{wechat_user}', 'WechatUserController@showSkinRecord');

/**
 * 肤质检测数据的管理
 *
 * @see \App\Http\Controllers\App\SkinRecordController
 */
Route::resource('/skin-record', 'SkinRecordController')
    ->names(\App\Http\Controllers\App\SkinRecordController::ROUTE_NAME);

/**
 * 发送测肤报告的模板消息
 *
 * @see \App\Http\Controllers\App\SkinRecordController::sendTemplateNotice()
 */
Route::post('/skin-record/send-template-notice', 'SkinRecordController@sendTemplateNotice');

/**
 * 发送测肤报告的模板消息
 *
 * @see \App\Http\Controllers\App\SkinRecordController::sendEmailReport()
 */
Route::post('/skin-record/send-email-report', 'SkinRecordController@sendEmailReport');

/**
 * @see \App\Http\Controllers\App\StoreController
 */
Route::resource('/store', 'StoreController');

/**
 * @see \App\Http\Controllers\App\StoreController::showInfo()
 */
Route::get('/store-info', 'StoreController@showInfo')
    ->name(\App\Http\Controllers\App\StoreController::ROUTES['show-info']);

/**
 * @see \App\Http\Controllers\App\StoreController::patchInfo()
 */
Route::patch('/store-info', 'StoreController@patchInfo')
    ->name(\App\Http\Controllers\App\StoreController::ROUTES['store-info']);

/**
 * 店铺整体妆容的素材
 *
 * @see \App\Http\Controllers\App\PackController
 */
Route::resource('/pack', 'PackController');

/**
 * 店铺商品信息
 *
 * @see \App\Http\Controllers\App\ProductController
 */
Route::resource('/product', 'ProductController')
    ->names(\App\Http\Controllers\App\ProductController::ROUTES);

/**
 * @see \App\Http\Controllers\App\ProductController::indexPage()
 */
Route::get('/product-page', 'ProductController@indexPage')
    ->name(\App\Http\Controllers\App\ProductController::ROUTES['indexPage']);

/**
 * spu-code搜索商品信息
 *
 * @see \App\Http\Controllers\App\ProductController::searchProductSpuCode()
 */
Route::get('/product-search-spu/{spu_code}', 'ProductController@searchProductSpuCode')
    ->name(\App\Http\Controllers\App\ProductController::ROUTES['search']);

/**
 * 增加商品试戴次数
 *
 * @see \App\Http\Controllers\App\ProductController::patchTryOn()
 */
Route::patch('/product-try-on/{product}', 'ProductController@patchTryOn')
    ->name(\App\Http\Controllers\App\ProductController::ROUTES['patch']);

/**
 * 返回设备账号的所有素材文件 （App端预加载）
 *
 * @see \App\Http\Controllers\App\PreloadAssetController::index()
 */
Route::get('/preload-asset', 'PreloadAssetController@index')
    ->name(\App\Http\Controllers\App\PreloadAssetController::ROUTES['index']);

/**
 * @deprecated - 推荐商品
 *
 * @see \App\Http\Controllers\App\RecommendProductController
 */
Route::resource('/recommend-product', 'RecommendProductController')
    ->names(\App\Http\Controllers\App\RecommendProductController::ROUTES);


/**
 * @deprecated - 推荐商品 v2
 *
 * @see \App\Http\Controllers\App\RecommendProductV2Controller
 */
Route::resource('/recommend-product-v2', 'RecommendProductV2Controller')
    ->names(\App\Http\Controllers\App\RecommendProductV2Controller::ROUTES);

/**
 * @deprecated - 推荐商品 (按照category_id分组) v2
 *
 * @see \App\Http\Controllers\App\RecommendProductV2Controller::indexGroupByCategoryId()
 */
Route::get('/index-group-by-category-id', 'RecommendProductV3Controller@index')
    ->name(\App\Http\Controllers\App\RecommendProductV2Controller::ROUTES['index-group-by-category-id']);

/**
 * 推荐商品 (按照category_id分组) v3
 *
 * @see \App\Http\Controllers\App\RecommendProductV3Controller::index()
 */
Route::get('/recommend-product-v3', 'RecommendProductV3Controller@index')
    ->name(\App\Http\Controllers\App\RecommendProductV3Controller::ROUTES['index']);


/**
 * 广告
 *
 * @see \App\Http\Controllers\App\AdvertController
 */
Route::resource('/advert', 'AdvertController')
    ->names(\App\Http\Controllers\App\AdvertController::ROUTE);

/**
 * app端屏保轮播图
 *
 * @see \App\Http\Controllers\App\BannerController
 */
Route::resource('/banner', 'BannerController')
    ->names(\App\Http\Controllers\App\BannerController::ROUTES);

/**
 * app端记录游客加入购物车的动作
 *
 * @see \App\Http\Controllers\App\OperateLogController::storeGuestAddCart()
 */
Route::post('/operate-log/guest-add-cart', 'OperateLogController@storeGuestAddCart')
    ->name(\App\Http\Controllers\App\OperateLogController::ROUTES['guest-add-cart']);

/**
 * 店员信息管理
 *
 * @see \App\Http\Controllers\App\StaffController
 */
Route::resource('/staff', 'StaffController')
    ->names(\App\Http\Controllers\App\StaffController::ROUTES);

/**
 * 返回客户的公司信息列表（新鸿基）
 *
 * @see \App\Http\Controllers\App\SunHungKai\CompanyManageController
 */
Route::resource('/customer-company', 'SunHungKai\CompanyManageController')
    ->names(\App\Http\Controllers\App\SunHungKai\CompanyManageController::ROUTES);


/**
 * 生成绑定店员的二维码
 *
 * @see \App\Http\Controllers\App\StaffController::bindingQrCode
 */
Route::post('/binding_staff', 'StaffController@bindingQrCode')
    ->name(\App\Http\Controllers\App\StaffController::ROUTES['binding_qr_code']);

/**
 * 轮询店员是否扫码
 *
 * @see \App\Http\Controllers\App\StaffController::bindingPoll()
 */
Route::get('/binding_poll/{scan_event_id}', 'StaffController@bindingPoll')
    ->name(\App\Http\Controllers\App\StaffController::ROUTES['binding_poll']);


/**
 * app端 登录店铺设置操作页面
 *
 * @see \App\Http\Controllers\App\DeviceAccountController::settingLogin()
 */
Route::post('/setting-login', 'DeviceAccountController@settingLogin')
    ->name(DeviceAccountController::ROUTES['setting-login']);

/**
 * @see \App\Http\Controllers\App\DeviceAccountController::refreshToken()
 */
Route::get('/refresh-token', 'DeviceAccountController@refreshToken')
    ->name(DeviceAccountController::ROUTES['refresh-token']);



